package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the NATIONALITY database table.
 * 
 */
@Entity
@NamedQuery(name="Nationality.findAll", query="SELECT n FROM Nationality n")
public class Nationality implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="NATIONALITY_NATIID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="NATIONALITY_NATIID_GENERATOR")
	@Column(name="NATI_ID")
	private long natiId;

	@Column(name="NATI_CREATORDATE")
	private Timestamp natiCreatordate;

	@Column(name="NATI_NAME")
	private String natiName;

	@Column(name="NATI_PERSON")
	private String natiPerson;

	@Column(name="NATI_UPDATEDATE")
	private Timestamp natiUpdatedate;

	//bi-directional many-to-one association to StaffInformation
	@OneToMany(mappedBy="nationality")
	@JSONField(serialize=false)
	private List<StaffInformation> staffInformations;

	public Nationality() {
	}

	public long getNatiId() {
		return this.natiId;
	}

	public void setNatiId(long natiId) {
		this.natiId = natiId;
	}

	public Timestamp getNatiCreatordate() {
		return this.natiCreatordate;
	}

	public void setNatiCreatordate(Timestamp natiCreatordate) {
		this.natiCreatordate = natiCreatordate;
	}

	public String getNatiName() {
		return this.natiName;
	}

	public void setNatiName(String natiName) {
		this.natiName = natiName;
	}

	public String getNatiPerson() {
		return this.natiPerson;
	}

	public void setNatiPerson(String natiPerson) {
		this.natiPerson = natiPerson;
	}

	public Timestamp getNatiUpdatedate() {
		return this.natiUpdatedate;
	}

	public void setNatiUpdatedate(Timestamp natiUpdatedate) {
		this.natiUpdatedate = natiUpdatedate;
	}

	public List<StaffInformation> getStaffInformations() {
		return this.staffInformations;
	}

	public void setStaffInformations(List<StaffInformation> staffInformations) {
		this.staffInformations = staffInformations;
	}

	public StaffInformation addStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().add(staffInformation);
		staffInformation.setNationality(this);

		return staffInformation;
	}

	public StaffInformation removeStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().remove(staffInformation);
		staffInformation.setNationality(null);

		return staffInformation;
	}

}